const { query } = require('../../config/mysqlPool')

exports.findUserByAccount = account => query('select * from user where account = ?', [account]);
exports.findUserById = id => query('select * from user where id = ?', [id]);
exports.findUserList = () => query('select creator,account,password,reg_time,role_name from user order by reg_time desc');
exports.insertUser = (params) => query(`insert into user (creator,account,password,role_id,role_name) values ('admin',?,?,?,?)`, params);